//
//  UITableView+Ext.swift
//  YiZhangGui
//
//  Created by Fexerlear on 2019/1/31.
//  Copyright © 2019 Mac. All rights reserved.
//

import UIKit



// MARK: - Methods
public extension UITableView {


    func cn_dequeueReusableSectionHeaderFooterView<T: UITableViewHeaderFooterView> (cls: T.Type) -> T {
        guard let headerFooterView = self.dequeueReusableHeaderFooterView(withIdentifier: "\(cls)") as? T else {
            fatalError("出错了,请检查注册方法")
        }
        
        return headerFooterView
    }
    
    // TODO: 获取SectionHeaderFooterView 使用字符串作为标识符
    ///
    ///
    ///
    func cn_dequeueReusableSectionHeaderFooterView<T: UITableViewHeaderFooterView> (withIdentifier: String) -> T {
        guard let headerFooterView = self.dequeueReusableHeaderFooterView(withIdentifier: withIdentifier) as? T else {
            fatalError("出错了,请检查注册方法")
        }
        return headerFooterView
    }




    
    
    
    
    
    
    
    


}
